package com.arvin.controller;


import com.arvin.service.ExcelExportService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Slf4j
@RequestMapping("/admin/export")
@Tag(name = "导出当届Excel文件",description = "导出excel文件存放本地")
public class ExcelExportController {

    @Autowired
    private ExcelExportService excelExportService;

    /**
     * 导出笔试人员信息表
     * @param response
     */
    @Operation(summary = "导出笔试人员信息表",description = "导出笔试人员信息表")
    @GetMapping("/examTable")
    public void ExportSignupTable(HttpServletResponse response,String examState,String className){
        excelExportService.exportExamTable(response,examState,className);
    }

    /**
     * 导出免试面试成绩表
     * @param response
     * @param exemState
     */
    @Operation(summary = "导出免试面试成绩表",description = "导出免试面试成绩表")
    @GetMapping("/exemIntvTable")
    public void ExportExemIntvTable(HttpServletResponse response,String exemState,String className){
        excelExportService.exportExemIntvTable(response,exemState,className);
    }

    /**
     * 导出面试成绩表
     * @param response
     * @param intvState
     */
    @Operation(summary = "导出面试成绩表",description = "导出面试成绩表")
    @GetMapping("/intvTable")
    public void ExportIntvTable(HttpServletResponse response,String intvState,String className){
        excelExportService.exportIntvTable(response,intvState,className);
    }

    /**
     * 导出综合成绩表
     * @param response
     */
    @Operation(summary = "导出综合成绩表",description = "导出综合成绩表")
    @GetMapping("/scoreTable")
    public void ExportScoreTable(HttpServletResponse response,String className){
        excelExportService.exportScoreTable(response,className);

    }

    /**
     * 导出入班学生表
     * @param response
     */
    @Operation(summary = "导出入班学生表",description = "导出入班学生表")
    @GetMapping("/enterTable")
    public void ExportEnterTable(HttpServletResponse response,String className){
        excelExportService.exportEnterTable(response,className);
    }

}
